<template>
  <!-- 卡片抽象成组件 -->
  <van-card
      v-for="user in props.userList"
      :desc="user.profile"
      :title="user.username"
      :thumb="user.avatar"
  >
    <template #tags>
      <van-tag plain type="primary" v-for="tag in user.tags" style="margin: 4px 4px 2px 0px">
        {{ tag }}
      </van-tag>
    </template>
    <template #footer>
      <van-button size="mini">联系我</van-button>
    </template>
  </van-card>

</template>

<script setup lang="ts">

import {CurrentUser} from "../models/user";

interface UserCardListProps {
  userList: CurrentUser[];
}

const props = withDefaults(defineProps<UserCardListProps>(), {
  userList: [] as CurrentUser[],
});

</script>

<style scoped>

</style>